package com.rojored.net.imageUploaderClasses
{

import flash.display.BitmapData;
import flash.geom.Rectangle;
import flash.utils.ByteArray;

/**
 *  Represents an image file.
 */
public class ImageFile
{

    //--------------------------------------------------------------------------
    //
    //  Constructor
    //
    //--------------------------------------------------------------------------

    /**
     *  Constructor
     */
    public function ImageFile(name:String = null, rawBytes:ByteArray = null,
                              mimeType:String = null,
                              dimensions:Rectangle = null,
                              bitmapData:BitmapData = null)
    {
        super();
        this.name = name;
        this.rawBytes = rawBytes;
        this.mimeType = mimeType;
        this.dimensions = dimensions;
        this.bitmapData = bitmapData;
    }

    //--------------------------------------------------------------------------
    //
    //  Properties
    //
    //--------------------------------------------------------------------------

    //--------------------------------------
    //  name
    //--------------------------------------

    /**
     *  the original name of the image file.
     */
    public var name:String;

    //--------------------------------------
    //  rawBytes
    //--------------------------------------

    /**
     *  A byte array that holds the raw bytes of the uploaded image as it was
     *  originally encoded.
     */
    public var rawBytes:ByteArray;

    //--------------------------------------
    //  mimeType
    //--------------------------------------

    /**
     *  String that holds the mime-type of the image file.
     */
    public var mimeType:String;

    //--------------------------------------
    //  dimensions
    //--------------------------------------

    /**
     *  Rectangle that holds the dimensions of the image.
     */
    public var dimensions:Rectangle;

    //--------------------------------------
    //  bitmapData
    //--------------------------------------

    /**
     *  Uncompressed bitmapData representation of the file.
     */
    public var bitmapData:BitmapData;

}
}
